home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_chapelelev.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  133 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_ChapelDoor.cog
  4. #
  5. # [RT & SXC]
  6. #
  7. # Mini-cutscene: Indy pulling a floor lever.
  8. #
  9. # Input:
  10. #    thing        indy        =    Cutscene actor Indy
  11. #    thing        camera    =    POV cutscene camera
  12. #    thing        lever        =    The lever...duh.
  13. #    flex        FOV        =    Camera field of view
  14. #
  15. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  16. #
  17. # ========================================================================================
  18.  
  19. symbols
  20.  
  21.     message        startup
  22.     message        activate
  23.  
  24.     keyframe    in_pull=in_pull_lever_down.key    local
  25.     keyframe    lever_down=gen_lever.key        local
  26.     keyframe    elevanim=inf_elvtr_gears.key    local
  27.           
  28.     sound       leverpull=nub_lever_pull_c.wav  local   
  29.     sound       leverback=nub_lever_reset_c.wav local
  30.     sound       gearplatmove=nub_weight_move_c.wav  local
  31.     sound       gearplatstart=nub_elev_start_c.wav  local
  32.     sound       gearplatstop=nub_elev_stop_c.wav    local   
  33.  
  34.     thing        player                            local
  35.  
  36.     thing        indy                            nolink
  37.     thing        camera
  38.     thing       camera_tgt0
  39.     thing        lever
  40.     thing       elevator
  41.     thing       elevator_cap
  42.     
  43.     int         pullcheck=0                     local
  44.     int         startchan                       local
  45.     int         movechan                        local
  46.     int         wepnum=1        local
  47.     int         lastrand=-1     local
  48.     int         currand=0       local
  49.     int         keychan         local
  50.     
  51.     sound       indylineb0=inxj058.wav      local
  52.     sound       indylineb1=inxj059.wav      local
  53.     sound       indylineb2=inxj060.wav      local
  54.     sound       indylineb3=inxj061.wav      local
  55.     sound       indylineb4=inxj090.wav      local
  56.     sound       indylineb5=inxj095.wav      local
  57.  
  58. end
  59.  
  60. # ================================================================================
  61.     
  62. code
  63.  
  64. startup:
  65.     AISetCutsceneMode(elevator);
  66.     player = GetLocalPlayerThing();
  67.     SetCollideType(elevator, 0);
  68.     ClearThingFlags(elevator, 0x80000);
  69. return;
  70.  
  71. # -------------------------------------------------------------------
  72. activate:
  73.     if ((GetSenderRef() == lever) && (pullcheck == 0) && (GetCurItem(player) == 0))
  74.     {
  75.         pullcheck = 1;
  76.         While(wepnum !=0)
  77.         {
  78.             wepnum = GetCurWeapon(player);
  79.             DeselectWeaponWait(player);
  80.             DeselectWeapon(player);
  81.             //printint(wepnum);
  82.         }
  83.         SetThingFlags(player, 0x80000);
  84.         SetCameraFocus(2, camera);
  85.         SetCameraSecondaryFocus(2, camera_tgt0);
  86.         SetCurrentCamera(2);
  87.         SetCameraFOV(70, 0, 0);
  88.         ClearThingFlags(indy, 0x80000);
  89.         PlayKey(lever, lever_down, 4, 0x12, 0);
  90.         PlaySoundThing(leverpull, lever, 1, 10, 20, 0);
  91.         PlayKey(indy, in_pull, 4, 0x12, 1);
  92.         SetCurrentCamera(1);
  93.         SetCameraFOV(90, 0, 0);
  94.         SetThingFlags(indy, 0x80000);
  95.         ClearThingFlags(player, 0x80000);
  96.         Sleep(1);
  97.         startchan=PlaySoundThing(gearplatstart, elevator, 1, 10, 20, 0);
  98.         WaitForSound(startchan);
  99.         keychan = PlayKey(elevator, elevanim, 2, 0x00, 0);
  100.         AISetMoveSpeed(elevator, 0.65);
  101.         AISetMoveFrame(elevator, 1);
  102.         AttachThingtoThing(elevator_cap, elevator);
  103.         //MoveToFrame(elevator_cap, 1, 2);
  104.         movechan=PlaySoundThing(gearplatmove, elevator_cap, 1, 10, 20, 1);
  105.         AIWaitForStop(elevator);
  106.         StopKey(elevator, keychan, 0.2);
  107.         StopSound(movechan, 0);
  108.         PlaySoundThing(gearplatstop, elevator, 1, 10, 20, 0);
  109.         pullcheck = 0;
  110.         wepnum=1;
  111.     }
  112.     
  113.     if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  114.     {
  115.         StopThing(player);
  116.         StartCutscene(0);
  117.         SetActorFlags(player, 0x200000);
  118.         currand = RandBetween(0, 5);
  119.         While (lastrand == currand)
  120.         {
  121.             currand = RandBetween(0, 5);
  122.         }
  123.         PlayVoice(player, indylineb0[currand], 1, 1);
  124.         lastrand = currand;
  125.         EndCutscene();
  126.         ClearActorFlags(player, 0x200000);
  127.     }
  128.     return;
  129.  
  130. end
  131.  
  132.